﻿@model List<OrderViewModel>
@{ 
    ViewData["Title"] = "Orders List";
}

<h3>Orders Management - Overview</h3>
<table class="table">
    <thead>
        <tr>
            <th>Order Id</th>
            <th>User Email</th>
            <th>Image</th>
            <th>Status</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var order in Model)
        {
        <tr class="clickable" onclick="location.href = '@Url.Action("Details", "OrderManagement", new { orderId = order.OrderId})'">
            <td>@order.OrderId</td>
            <td>@order.UserEmail</td>
            <td><img src="@order.ImageString" width="50px" height="50px" /></td>
            <td>@order.OrderStatus</td>
        </tr>
        }
    </tbody>
</table>